package br.ufpi.repositories;

import javax.persistence.EntityManager;

import br.com.caelum.vraptor.validator.ValidationException;
import br.ufpi.controllers.UserController;
import br.ufpi.controllers.procedure.UsuarioTestProcedure;
import br.ufpi.model.User;
import br.ufpi.model.Enum.EnumPerfil;

public class Populator {
	public static void criarAdmin(EntityManager entityManager) {
		try {
			UserController usuarioController = UsuarioTestProcedure
					.newInstanceUsuarioController(entityManager);
			User usuario = UsuarioTestProcedure.newInstaceUsuario(
					entityManager, "Cleiton", "cleitonmoura18@gmail.com",
					"killline", "(86)3227-0468", "killline", EnumPerfil.OWNER);
			usuarioController.create(usuario, "killline");
		} catch (ValidationException e) {
			System.err.println(e.getMessage());
		}

	}
	
}
